﻿using Marmat.Common.Http.Attributes;
using System;
using System.Collections.Generic;
using System.Text;

namespace Marmat.Common.Http
{
    [FromForm]
    public class FormCollection
    {
        private readonly FormFileCollection files = new FormFileCollection();
        private readonly Dictionary<string, string> collection = new Dictionary<string, string>();

        /// <summary>
        /// 获取指定key值的值。
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string this[string key]
        {
            get => collection[key];
            set => collection[key] = value;
        }

        /// <summary>
        /// 与请求一起发送的文件集合。
        /// </summary>
        public FormFileCollection Files => files;

        /// <summary>
        /// 与请求一起发送的Key集合。
        /// </summary>
        public Dictionary<string, string> Keys => this.collection;
    }
}
